package com.programbookstore.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import org.springframework.transaction.annotation.Transactional;

import com.programbookstore.dao.BookDAO;
import com.programbookstore.model.Book;
import com.programbookstore.service.BookService;

@Transactional
@Service
public class BookServiceImpl implements BookService {

	@Autowired
	private BookDAO bookDao;

	@Override
	public List<Book> ListBook() {

		return bookDao.ListBook();
	}

	@Override
	public void updateBook(Book book) {
		bookDao.updateBook(book);

	}

	@Override
	public void deleteBook(int id) {
		bookDao.deleteBook(id);

	}

	@Override
	public void addBook(Book book) {
		bookDao.addBook(book);
	}

	@Override
	public Book getBook(int id) {
		return bookDao.getBook(id);
	}

}
